<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <link rel="stylesheet" href="./css/animate.css">
    <title>Document</title>
    <style>
    li{
        width: 200px;
        height: 30px;
        background: yellowgreen;
        margin-top: 10px
    }
    </style>
    <script src="./js/vue.js"></script>
</head>
<body>
    <div id="app">
        <div>
            
            <input type="text" v-model="val">
            <ul>
               <transition-group enter-active-class="bounceInLeft" leave-active-class="bounceOutRight">
                    <li v-for="(item,index) in Lists" class="animated" :key="index">
                            {{item}}
                        </li>
               </transition-group>
            </ul>
        </div>
    </div>
    <script>
    new Vue({
        el:"#app",
        data:{
            nameList:["Msea", "陶气", "陶宝", "猫猫", "撸猫", "机器猫", "二傻子"],
            val:""
        },
        computed: {
            Lists(){
                var arr=[];
                this.nameList.forEach(item => {
                    // console.log(item) //就是所有元素
                    if(item.indexOf(this.val)!=-1){
                        arr.push(item)
                    }
                });
                return arr;
            }
        },
    })
    
    </script>
    
</body>
</html>